import request  from "../utils/request"
import qs from "querystring"


export const saveOrUpdateCus = (data)=>{
    return request.post("/customer",data);
}

export const deleteCusById = (customerId) => {
    return request.delete("/customer/"+customerId);
} 

export const deleteCusByBatch = (customerIds)=>{
    return request.delete("/customer/batchDelete?customerIds="+customerIds)
}

export const findCusByPage = (query)=>{
    return request.get("/customer",{
        params: query,
        paramsSerializer:(params)=>{
            return qs.stringify(params);
        }
    })
}

export const findCusByCondition = (query)=>{
    return request.get("/customer/by/condition",{
        params: query,
        paramsSerializer:(params)=>{
            return qs.stringify(params);
        }
    })
}
